using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Team_List - 团队信息 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class ITeamList<T> :ModelBase<TeamList> where T : TeamList, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.TeamId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return TeamId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.TeamId=dy.TeamId;
           this.Title=dy.Title;
           this.ImageId=dy.ImageId;
           this.AdminId=dy.AdminId;
           this.Detailed=dy.Detailed;
           this.Version=dy.Version;
        } 

        #region 定义属性

     
         /// <summary>
        /// TeamId
        /// </summary>
        private String _TeamId = "";
      
        /// <summary>
        /// TeamId
        /// </summary>
        public String TeamId
        {
            get 
            {
              return   (this._TeamId); 
            }

            set 
            {
                    _TeamId= value;  
            }
        }
       
     
         /// <summary>
        /// 组名称
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 组名称
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// 图片
        /// </summary>
        private String _ImageId = "";
      
        /// <summary>
        /// 图片
        /// </summary>
        public String ImageId
        {
            get 
            {
              return   (this._ImageId); 
            }

            set 
            {
                    _ImageId= value;  
            }
        }
       
     
         /// <summary>
        /// 团队管理员Id
        /// </summary>
        private String _AdminId = "";
      
        /// <summary>
        /// 团队管理员Id
        /// </summary>
        public String AdminId
        {
            get 
            {
              return   (this._AdminId); 
            }

            set 
            {
                    _AdminId= value;  
            }
        }
       
     
         /// <summary>
        /// 说明
        /// </summary>
        private String _Detailed = "";
      
        /// <summary>
        /// 说明
        /// </summary>
        public String Detailed
        {
            get 
            {
              return   (this._Detailed); 
            }

            set 
            {
                    _Detailed= value;  
            }
        }
       
     
      

      #endregion 定义属性 

          protected internal override void SetValue(TeamList info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["TeamId"]!= DBNull.Value)
                  {
                  info.TeamId=row["TeamId"].ToString();
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["ImageId"]!= DBNull.Value)
                  {
                  info.ImageId=row["ImageId"].ToString();
                 }
                 
                  
                  if(row["AdminId"]!= DBNull.Value)
                  {
                  info.AdminId=row["AdminId"].ToString();
                 }
                 
                  
                  if(row["Detailed"]!= DBNull.Value)
                  {
                  info.Detailed=row["Detailed"].ToString();
                 }
                 
                  
                  if(row["Version"]!= DBNull.Value)
                  {
                  info.Version=row["Version"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, TeamList info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@TeamId", DbType.String,ParameterTool.GetObj( info._TeamId )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@ImageId", DbType.String,ParameterTool.GetObj( info._ImageId )); 
            
             
                cn.AddInParameter(comm, "@AdminId", DbType.String,ParameterTool.GetObj( info._AdminId )); 
            
             
                cn.AddInParameter(comm, "@Detailed", DbType.String,ParameterTool.GetObj( info._Detailed )); 
            
                
                cn.AddInParameter(comm,"@Version", DbType.String, Guid.NewGuid().ToString());
              

                cn.AddInParameter(comm,"@_versionOdl", DbType.String, info._Version); 
                 
        } 

    } 
} 